package com.device.repository;
import com.device.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


public interface UserRepository extends JpaRepository<User,Integer> {

    User findByOpenid(String openid);

    @Query(value = "select u from User u where u.isRegister = :register")
    Page<User> RegisteredOrNot(Boolean register, Pageable pageable);

    User findByUserName(String userName);

}
